﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterClinicaSanPablo.Master" EnableEventValidation="false"
    AutoEventWireup="true" CodeBehind="BusquedaSeguimientoSNC.aspx.cs" Inherits="ClinicaSanPablo.BusquedaSeguimientoSNC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {

            $('#btnBuscarSNC').click(function () {
                $("#grdListSNC").trigger("reloadGrid");
                return false;
            });

            $("#grdListSNC").jqGrid({
                url: "BusSNC.aspx",
                datatype: 'json',
                type: 'GET',
                colNames: ['Codigo', 'Descripcion', 'FechaRegistro'],
                colModel: [
                    { name: 'Id', index: 'Id', align: 'center', width: 100, sortable: false },
                    { name: 'Descripcion', index: 'Descripcion', align: 'center', width: 650, sortable: false },
                    { name: 'FechaRegistro', index: 'FechaRegistro', align: 'center', width: 140, sortable: false },
                    ],
                pager: jQuery('#grdPagerSNC'),
                rowNum: 20,
                rowList: [20, 50, 100],
                sortname: 'Id',
                sortorder: 'desc',
                postData: {
                    codigoSNC: function () { return $("#txtCodigo").val(); },
                    descripcionSNC: function () { return $("#txtDescripcion").val(); },
                    areaInvolucrada: function () { return $("#cmbAreaInvolucrada").val(); }
                },
                ondblClickRow: function (id) {

                    var ret = jQuery("#grdListSNC").jqGrid('getRowData', id);

                    window.location = "SeguimientoServicioNoConforme.aspx?codigoSNC=" + ret.Id;

                }
            });


            $.ajax({
                type: "POST",
                url: "BusquedaSeguimientoSNC.aspx/ComboArea",
                data: {},
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                    for (var i = 0; i < models.length; i++) {
                        var val = models[i].CodArea;
                        var text = models[i].DesArea;
                        $("#cmbAreaInvolucrada").get(0).options[$("#cmbAreaInvolucrada").get(0).options.length] = new Option(text, val);
                    }
                },
                error: function (response) {
                    if (response.length != 0)
                        alert(response);
                }
            });


        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="master" runat="server">
    <form id="busquedaSeguimientoSNC" runat="server">
    <div class="cuerpo">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="3">
                    <img src="images/caja_main01.gif" width="973" height="13" />
                </td>
            </tr>
            <tr>
                <td width="7" background="images/caja_main02.gif">
                    &nbsp;
                </td>
                <td class="info" valign="top">
                    <h1>
                        Seguimiento de <strong>Servicios No Conformes</strong></h1>
                    <div class="content" id="page-2">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="TablaStyle">
                            <tr>
                                <td width="6">
                                </td>
                                <td>
                                </td>
                                <td width="6">
                                </td>
                            </tr>
                            <tr>
                                <td width="6">
                                    &nbsp;
                                </td>
                                <td bgcolor="#eeeeee">
                                    <table width="95%" border="0" align="center" cellpadding="2" cellspacing="1">
                                        <tr>
                                            <td width="85">
                                                Código SNC:
                                            </td>
                                            <td width="60">
                                                <asp:TextBox ID="txtCodigo" runat="server" CssClass="frm"></asp:TextBox>
                                            </td>
                                            <td width="120" align="right">
                                                Descripción SNC:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDescripcion" runat="server" CssClass="frm"></asp:TextBox>
                                            </td>
                                            <td width="110" align="right">
                                                Area Involucrada:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cmbAreaInvolucrada" runat="server" Height="22px" Width="200px">
                                                    <asp:ListItem Text="---Seleccione un Área---" Value="" Selected="True"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <button id="btnBuscarSNC" class="submitBtn">
                                                    <span>Buscar</span></button>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td width="6">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="6">
                                </td>
                                <td>
                                </td>
                                <td width="6">
                                </td>
                            </tr>
                        </table>
                        <br />
                        <div style="width: 100%;" id="asd">
                            <table id="grdListSNC">
                            </table>
                        </div>
                        <div id="grdPagerSNC">
                        </div>
                        <br />
                    </div>
                </td>
                <td width="7" background="images/caja_main03.gif">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <img src="images/caja_main04.gif" width="973" height="13" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</asp:Content>
